#pragma once
#ifndef _CARD_INTERACTION_AUDIOPLAYER_H_
#define _CARD_INTERACTION_AUDIOPLAYER_H_
#include <QSound>
#define  MUSIC_LOOP_TIMES  100
class AudioPlayer
{
public:
	AudioPlayer(const char *fileName,bool isLoop = false);
	~AudioPlayer();

	void PlayMusic()
	{
		mSoundPlayer->play();
	}
	void StopMusic()
	{
		mSoundPlayer->stop();
	}
	void SetMusicLoop(int times)
	{
		mSoundPlayer->setLoops(times);
	}
	int  GetMusicRemainLoop()
	{
		return mSoundPlayer->loopsRemaining();
	}
	bool IsFinished()
	{
		return mSoundPlayer->isFinished();
	}
protected:
	
private:
	bool mIsLoop;
	QSound    *mSoundPlayer;
};
#endif